package main;

import javax.swing.UIManager;

import util.Resources;
import view.swing.NewGameWindow;
import view.swing.NewPlayerView;
import controller.GameController;

public class Start {
    public static void main(String[] args) {

        // Faire en sorte que Swing prenne l'apparence du système (Linux,
        // Mac...)
        try {
        	
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            System.err.println(Resources.getString("Error.LookAndFeel"));
        }

        GameController controler = new GameController();
        // fenêtre pour demander les prénoms des joueurs
        NewGameWindow test = new NewGameWindow(new NewPlayerView(), controler);
        test.pack();
        /*

        if (args.length > 0 && args.length <= 4) {
            for (String playerName : args) {
                sg.addPlayer(new Player(playerName));
            }
        } else {
            sg.addPlayer(new Player(String.format(STR_DEFAULT_PLAYER_NAME, 1)));
            sg.addPlayer(new Player(String.format(STR_DEFAULT_PLAYER_NAME, 2)));
        }

        

        IBoardView boardView = new BoardView(sg.getBoard());

        MoveListModel listModel = new MoveListModel();
        ILogView logView = new LogView(listModel);
        sg.addTurnListener(logView);
        sg.addTurnListener(listModel);

        PlayersTableModel tableModel = new PlayersTableModel(sg.getPlayers());
        IPlayersView playersView = new PlayersView(tableModel);
        for (Player player : sg.getPlayers()) {
            player.addScoreListener(playersView);
        }
        
        sg.addPlayerListener(playersView);
        sg.addPlayerListener(tableModel);
        sg.firePlayerListeners();
        IRackView rackView = new RackView(sg.getCurrentPlayer()
                .getRack());
        sg.addRackListener(rackView);

        controler.init(boardView, logView, playersView, rackView);
        
        MainWindow mainWindow = new MainWindow(controler, boardView, playersView, logView,
                rackView);
        
	*/

        
    }
}